home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / MoreFiles 1.2.1 / MoreFiles.p < prev    next >
Encoding:
Text File  |  1994-07-22  |  23.9 KB  |  641 lines  |  [TEXT/PJMM]

  1. UNIT MoreFiles;
  2.  
  3. {    Apple Macintosh Developer Technical Support                                }
  4. {                                                                            }
  5. {    The long lost high-level and FSSpec File Manager functions.                }
  6. {    by Jim Luther, Apple Developer Technical Support                        }
  7. {                                                                            }
  8. {    File:        MoreFiles.p                                                    }
  9. {                                                                            }
  10. {    Copyright © 1992-1994 Apple Computer, Inc.                                }
  11. {    All rights reserved.                                                    }
  12. {                                                                            }
  13. {    You may incorporate this sample code into your applications without        }
  14. {    restriction, though the sample code has been provided "AS IS" and the    }
  15. {    responsibility for its operation is 100% yours.  However, what you are    }
  16. {    not permitted to do is to redistribute the source as "DSC Sample Code"    }
  17. {    after having made changes. If you're going to re-distribute the source,    }
  18. {    we require that you make it clear in the source that the code was        }
  19. {    descended from Apple Sample Code, but that you've made changes.            }
  20.  
  21.  
  22. INTERFACE
  23.  
  24. {***************************************************************************}
  25.  
  26.  
  27.     FUNCTION HGetVolParms (volName: StringPtr;
  28.                                     vRefNum: Integer;
  29.                                     VAR volParmsInfo: GetVolParmsInfoBuffer;
  30.                                     VAR infoSize: LongInt): OSErr;
  31. {    Use HGetVolParms to determine the characteristics of a volume.            }
  32. {    A result of paramErr usually just means the volume doesn't                }
  33. {    support PBHGetVolParms and the feature you were going to check            }
  34. {    for isn't available.                                                    }
  35. {                                                                            }
  36. {    volName            input:    A pointer to the name of a mounted volume        }
  37. {                            or nil.                                            }
  38. {    vRefNum            input:    Volume specification.                            }
  39. {    volParmsInfo    input:    Pointer to GetVolParmsInfoBuffer where the        }
  40. {                            volume attributes information is returned.        }
  41. {                    output:    Atributes information.                            }
  42. {    infoSize        input:    Size of buffer pointed to by volParmsInfo.        }
  43. {                    output: Size of data actually returned.                    }
  44.  
  45.  
  46. {***************************************************************************}
  47.  
  48.  
  49.     FUNCTION HCreateMinimum (vRefNum: Integer;
  50.                                     dirID: LongInt;
  51.                                     fileName: Str255): OSErr;
  52. {    Use HCreateMinimum to create a new file without attempting to set the    }
  53. {    creator and file type of the new file.  This function is needed to        }
  54. {    create a file in an AppleShare "drop box" where the user can make        }
  55. {    changes, but cannot see folder or files.                                }
  56. {                                                                            }
  57. {    vRefNum        input:    Volume specification.                                }
  58. {    dirID        input:    Directory ID.                                        }
  59. {    fileName    input:    The name of the new file.                            }
  60.  
  61.  
  62. {***************************************************************************}
  63.  
  64.  
  65.     FUNCTION FSpCreateMinimum (spec: FSSpec): OSErr;
  66. {    Use FSpCreateMinimum to create a new file without attempting to set        }
  67. {    the creator and file type of the new file.  This function is needed to    }
  68. {    create a file in an AppleShare "dropbox" where the user can make        }
  69. {    changes, but cannot see folder or files.                                }
  70. {                                                                            }
  71. {    spec        input:    An FSSpec record specifying the file to create.        }
  72.  
  73.  
  74. {***************************************************************************}
  75.  
  76.  
  77.     FUNCTION ExchangeFiles (vRefNum: Integer;
  78.                                     srcDirID: LongInt;
  79.                                     srcName: Str255;
  80.                                     dstDirID: LongInt;
  81.                                     dstName: Str255): OSErr;
  82. {    Use ExchangeFiles to exchange the data stored in two files on the        }
  83. {    same volume.                                                            }
  84. {                                                                            }
  85. {    vRefNum        input:    Volume specification.                                }
  86. {    srcDirID    input:    Source directory ID.                                }
  87. {    srcName        input:    Source file name.                                    }
  88. {    dstDirID    input:    Destination directory ID.                            }
  89. {    dstName        input:    Destination file name.                                }
  90.  
  91.  
  92. {***************************************************************************}
  93.  
  94.  
  95.     FUNCTION ResolveFileIDRef (volName: StringPtr;
  96.                                     vRefNum: Integer;
  97.                                     fileID: LongInt;
  98.                                     VAR parID: LongInt;
  99.                                     fileName: StringPtr): OSErr;
  100. {    Use ResolveFileIDRef to retrieve the filename and parent directory ID    }
  101. {    of the file with the specified file ID.                                    }
  102. {                                                                            }
  103. {    volName    input:    A pointer to the name of a mounted volume                }
  104. {                    or nil.                                                    }
  105. {    fileID    input:    The file ID.                                            }
  106. {    vRefNum    input:    Volume specification.                                    }
  107. {    parID    output:    The parent directory ID of the file.                    }
  108. {    name    input:    Points to a buffer (minimum Str63) where the filename    }
  109. {                    is to be returned or must be nil.                        }
  110. {            output:    The filename.                                            }
  111.  
  112.  
  113. {***************************************************************************}
  114.  
  115.  
  116.     FUNCTION CreateFileIDRef (vRefNum: Integer;
  117.                                     parID: LongInt;
  118.                                     fileName: Str255;
  119.                                     VAR fileID: LongInt): OSErr;
  120. {    Use CreateFileIDRef to establish a file ID for a file.                    }
  121. {                                                                            }
  122. {    vRefNum        input:    Volume specification.                                }
  123. {    parID        input:    Directory ID.                                        }
  124. {    fileName    input:    The name of the file.                                }
  125. {    fileID        output:    The file ID.                                        }
  126.  
  127.  
  128. {***************************************************************************}
  129.  
  130.  
  131.     FUNCTION FSpCreateFileIDRef (spec: FSSpec;
  132.                                     VAR fileID: LongInt): OSErr;
  133. {    Use FSpCreateFileIDRef to establish a file ID for a file.                }
  134. {                                                                            }
  135. {    spec        input:    An FSSpec record specifying the file.                }
  136. {    fileID        output:    The file ID.                                        }
  137.  
  138.  
  139. {***************************************************************************}
  140.  
  141.  
  142.     FUNCTION DeleteFileIDRef (volName: StringPtr;
  143.                                     vRefNum: Integer;
  144.                                     fileID: LongInt): OSErr;
  145. {    Use DeleteFileIDRef to delete a file ID reference.                        }
  146. {                                                                            }
  147. {    volName    input:    A pointer to the name of a mounted volume                }
  148. {                    or nil.                                                    }
  149. {    vRefNum    input:    Volume specification.                                    }
  150. {    fileID    input:    The file ID.                                            }
  151.  
  152.  
  153. {***************************************************************************}
  154.  
  155.  
  156.     FUNCTION FlushFile (refNum: Integer): OSErr;
  157. {    Use FlushFile to write the contents of a file's access path buffer.        }
  158. {                                                                            }
  159. {    refNum    input:    The file reference number of an open file.                }
  160.  
  161.  
  162. {***************************************************************************}
  163.  
  164.  
  165.     FUNCTION LockRange (refNum: Integer;
  166.                                     rangeLength: LongInt;
  167.                                     rangeStart: LongInt): OSErr;
  168. {    Use LockRange to lock a portion of a file.                                }
  169. {                                                                            }
  170. {    refNum        input:    The file reference number of an open file.            }
  171. {    rangeLength    input:    The number of bytes in the range.                    }
  172. {    rangeStart    input:    The starting byte in the range to lock.                }
  173.  
  174.  
  175. {***************************************************************************}
  176.  
  177.  
  178.     FUNCTION UnlockRange (refNum: Integer;
  179.                                     rangeLength: LongInt;
  180.                                     rangeStart: LongInt): OSErr;
  181. {    Use UnlockRange to unlock a previously locked range.                    }
  182. {                                                                            }
  183. {    refNum        input:    The file reference number of an open file.            }
  184. {    rangeLength    input:    The number of bytes in the range.                    }
  185. {    rangeStart    input:    The starting byte in the range to unlock.            }
  186.  
  187.  
  188. {***************************************************************************}
  189.  
  190.  
  191.     FUNCTION GetForeignPrivs (vRefNum: Integer;
  192.                                     dirID: LongInt;
  193.                                     name: StringPtr;
  194.                                     foreignPrivBuffer: Ptr;
  195.                                     VAR foreignPrivSize: LongInt;
  196.                                     VAR foreignPrivInfo1: LongInt;
  197.                                     VAR foreignPrivInfo2: LongInt;
  198.                                     VAR foreignPrivInfo3: LongInt;
  199.                                     VAR foreignPrivInfo4: LongInt): OSErr;
  200. {    Use GetForeignPrivs to determine the native access-control                }
  201. {    information for a file or directory stored on a volume managed by        }
  202. {    a foreign file system.                                                    }
  203. {                                                                            }
  204. {    vRefNum                input:    Volume specification.                        }
  205. {    dirID                input:    Directory ID.                                }
  206. {    name                input:    Pointer to object name, or nil when dirID    }
  207. {                                specifies a directory that's the object.    }
  208. {    foreignPrivBuffer    input:    Pointer to buffer where the privilege        }
  209. {                                information is returned.                    }
  210. {                        output:    Privilege information.                        }
  211. {    foreignPrivSize        input:    Size of buffer pointed to by                }
  212. {                                foreignPrivBuffer.                            }
  213. {                        output: Amount of buffer actually used.                }
  214. {    foreignPrivInfo1    output:    Information specific to privilege model.    }
  215. {    foreignPrivInfo2    output:    Information specific to privilege model.    }
  216. {    foreignPrivInfo3    output:    Information specific to privilege model.    }
  217. {    foreignPrivInfo4    output:    Information specific to privilege model.    }
  218.  
  219.  
  220. {***************************************************************************}
  221.  
  222.  
  223.     FUNCTION FSpGetForeignPrivs (spec: FSSpec;
  224.                                     foreignPrivBuffer: Ptr;
  225.                                     VAR foreignPrivSize: LongInt;
  226.                                     VAR foreignPrivInfo1: LongInt;
  227.                                     VAR foreignPrivInfo2: LongInt;
  228.                                     VAR foreignPrivInfo3: LongInt;
  229.                                     VAR foreignPrivInfo4: LongInt): OSErr;
  230. {    Use FSpGetForeignPrivs to determine the native access-control            }
  231. {    information for a file or directory stored on a volume managed by        }
  232. {    a foreign file system.                                                    }
  233. {                                                                            }
  234. {    spec                input:    An FSSpec record specifying the object.        }
  235. {    foreignPrivBuffer    input:    Pointer to buffer where the privilege        }
  236. {                                information is returned.                    }
  237. {                        output:    Privilege information.                        }
  238. {    foreignPrivSize        input:    Size of buffer pointed to by                }
  239. {                                foreignPrivBuffer.                            }
  240. {                        output: Amount of buffer actually used.                }
  241. {    foreignPrivInfo1    output:    Information specific to privilege model.    }
  242. {    foreignPrivInfo2    output:    Information specific to privilege model.    }
  243. {    foreignPrivInfo3    output:    Information specific to privilege model.    }
  244. {    foreignPrivInfo4    output:    Information specific to privilege model.    }
  245.  
  246.  
  247.  
  248. {***************************************************************************}
  249.  
  250.  
  251.     FUNCTION SetForeignPrivs (vRefNum: Integer;
  252.                                     dirID: LongInt;
  253.                                     name: StringPtr;
  254.                                     foreignPrivBuffer: Ptr;
  255.                                     VAR foreignPrivSize: LongInt;
  256.                                     foreignPrivInfo1: LongInt;
  257.                                     foreignPrivInfo2: LongInt;
  258.                                     foreignPrivInfo3: LongInt;
  259.                                     foreignPrivInfo4: LongInt): OSErr;
  260. {    Use SetForeignPrivs to change the native access-control information        }
  261. {    for a file or directory stored on a volume managed by a foreign            }
  262. {    file system.                                                            }
  263. {                                                                            }
  264. {    vRefNum                input:    Volume specification.                        }
  265. {    dirID                input:    Directory ID.                                }
  266. {    name                input:    Pointer to object name, or nil when dirID    }
  267. {                                specifies a directory that's the object.    }
  268. {    foreignPrivBuffer    input:    Pointer to privilege information buffer.    }
  269. {    foreignPrivSize        input:    Size of buffer pointed to by                }
  270. {                                foreignPrivBuffer.                            }
  271. {                        output: Amount of buffer actually used.                }
  272. {    foreignPrivInfo1    input:    Information specific to privilege model.    }
  273. {    foreignPrivInfo2    input:    Information specific to privilege model.    }
  274. {    foreignPrivInfo3    input:    Information specific to privilege model.    }
  275. {    foreignPrivInfo4    input:    Information specific to privilege model.    }
  276.  
  277.  
  278. {***************************************************************************}
  279.  
  280.  
  281.     FUNCTION FSpSetForeignPrivs (spec: FSSpec;
  282.                                     foreignPrivBuffer: Ptr;
  283.                                     VAR foreignPrivSize: LongInt;
  284.                                     foreignPrivInfo1: LongInt;
  285.                                     foreignPrivInfo2: LongInt;
  286.                                     foreignPrivInfo3: LongInt;
  287.                                     foreignPrivInfo4: LongInt): OSErr;
  288. {    Use FSpSetForeignPrivs to change the native access-control information    }
  289. {    for a file or directory stored on a volume managed by a foreign            }
  290. {    file system.                                                            }
  291. {                                                                            }
  292. {    spec                input:    An FSSpec record specifying the object.        }
  293. {    foreignPrivBuffer    input:    Pointer to privilege information buffer.    }
  294. {    foreignPrivSize        input:    Size of buffer pointed to by                }
  295. {                                foreignPrivBuffer.                            }
  296. {                        output: Amount of buffer actually used.                }
  297. {    foreignPrivInfo1    input:    Information specific to privilege model.    }
  298. {    foreignPrivInfo2    input:    Information specific to privilege model.    }
  299. {    foreignPrivInfo3    input:    Information specific to privilege model.    }
  300. {    foreignPrivInfo4    input:    Information specific to privilege model.    }
  301.  
  302.  
  303. {***************************************************************************}
  304.  
  305.  
  306.     FUNCTION HGetLogInInfo (volName: StringPtr;
  307.                                     vRefNum: Integer;
  308.                                     VAR loginMethod: Integer;
  309.                                     userName: StringPtr): OSErr;
  310. {    Use HGetLogInInfo to determine the login method and user name used to    }
  311. {    log on to a particular shared volume.                                    }
  312. {                                                                            }
  313. {    volName        input:    A pointer to the name of a mounted volume            }
  314. {                        or nil.                                                }
  315. {    vRefNum        input:    The volume reference number.                        }
  316. {    loginMethod    output:    The login method used (kNoUserAuthentication,        }
  317. {                        kPassword, kEncryptPassword, or                        }
  318. {                        kTwoWayEncryptPassword).                            }
  319. {    userName    input:    Points to a buffer (minimum Str31) where the user    }
  320. {                        name is to be returned or must be nil.                }
  321. {                output:    The user name.                                        }
  322.  
  323.  
  324. {***************************************************************************}
  325.  
  326.  
  327.     FUNCTION HGetDirAccess (vRefNum: Integer;
  328.                                     dirID: LongInt;
  329.                                     name: StringPtr;
  330.                                     VAR ownerID: LongInt;
  331.                                     VAR groupID: LongInt;
  332.                                     VAR accessRights: LongInt): OSErr;
  333. {    Use HGetDirAccess to get the directory access control information for    }
  334. {    a directory on a shared volume.                                            }
  335. {                                                                            }
  336. {    vRefNum            input:    Volume specification.                            }
  337. {    dirID            input:    Directory ID.                                    }
  338. {    name            input:    Pointer to directory name, or nil if dirID        }
  339. {                            specifies the directory.                        }
  340. {    ownerID            output:    The directory's owner ID.                        }
  341. {    groupID            output:    The directory's group ID or                        }
  342. {                            0 if no group affiliation.                        }
  343. {    accessRights    output:    The directory's access rights.                    }
  344.  
  345.  
  346. {***************************************************************************}
  347.  
  348.  
  349.     FUNCTION FSpGetDirAccess (spec: FSSpec;
  350.                                     VAR ownerID: LongInt;
  351.                                     VAR groupID: LongInt;
  352.                                     VAR accessRights: LongInt): OSErr;
  353. {    Use FSpGetDirAccess to get the directory access control information        }
  354. {    for a directory on a shared volume.                                        }
  355. {                                                                            }
  356. {    spec            input:    An FSSpec record specifying the directory.        }
  357. {    ownerID            output:    The directory's owner ID.                        }
  358. {    groupID            output:    The directory's group ID or                        }
  359. {                            0 if no group affiliation.                        }
  360. {    accessRights    output:    The directory's access rights.                    }
  361.  
  362.  
  363. {***************************************************************************}
  364.  
  365.  
  366.     FUNCTION HSetDirAccess (vRefNum: Integer;
  367.                                     dirID: LongInt;
  368.                                     name: StringPtr;
  369.                                     ownerID: LongInt;
  370.                                     groupID: LongInt;
  371.                                     accessRights: LongInt): OSErr;
  372. {    Use HSetDirAccess to change the directory access control information    }
  373. {    for a directory on a shared volume.                                        }
  374. {                                                                            }
  375. {    vRefNum            input:    Volume specification.                            }
  376. {    dirID            input:    Directory ID.                                    }
  377. {    name            input:    Pointer to directory name, or nil if dirID        }
  378. {                            specifies the directory.                        }
  379. {    ownerID            output:    The directory's owner ID.                        }
  380. {    groupID            output:    The directory's group ID or                        }
  381. {                            0 if no group affiliation.                        }
  382. {    accessRights    output:    The directory's access rights.                    }
  383.  
  384.  
  385. {***************************************************************************}
  386.  
  387.  
  388.     FUNCTION FSpSetDirAccess (spec: FSSpec;
  389.                                     ownerID: LongInt;
  390.                                     groupID: LongInt;
  391.                                     accessRights: LongInt): OSErr;
  392. {    Use FSpSetDirAccess to change the directory access control information    }
  393. {    for a directory on a shared volume.                                        }
  394. {                                                                            }
  395. {    spec            input:    An FSSpec record specifying the directory.        }
  396. {    ownerID            output:    The directory's owner ID.                        }
  397. {    groupID            output:    The directory's group ID or                        }
  398. {                            0 if no group affiliation.                        }
  399. {    accessRights    output:    The directory's access rights.                    }
  400.  
  401.  
  402. {***************************************************************************}
  403.  
  404.  
  405.     FUNCTION HMapID (volName: StringPtr;
  406.                                     vRefNum: Integer;
  407.                                     ID: LongInt;
  408.                                     objType: Integer;
  409.                                     name: StringPtr): OSErr;
  410. {    Use HMapID to determine the name of a user or group if you know the        }
  411. {    user or group ID.                                                        }
  412. {                                                                            }
  413. {    volName        input:    A pointer to the name of a mounted volume            }
  414. {                        or nil.                                                }
  415. {    vRefNum        input:    Volume specification.                                }
  416. {    objType        input:    The mapping function code: 1 if you're mapping a    }
  417. {                        user ID to a user name or 2 if you're mapping a        }
  418. {                        group ID to a group name.                            }
  419. {    name        input:    Points to a buffer (minimum Str31) where the user    }
  420. {                        or group name is to be returned or must be nil.        }
  421. {                output:    The user or group name.                                }
  422.  
  423.  
  424. {***************************************************************************}
  425.  
  426.  
  427.     FUNCTION HMapName (volName: StringPtr;
  428.                                     vRefNum: Integer;
  429.                                     name: Str255;
  430.                                     objType: Integer;
  431.                                     VAR ID: LongInt): OSErr;
  432. {    Use HMapName to determine the user or group ID if you know the user or    }
  433. {    group name.                                                                }
  434. {                                                                            }
  435. {    volName        input:    A pointer to the name of a mounted volume            }
  436. {                        or nil.                                                }
  437. {    vRefNum        input:    Volume specification.                                }
  438. {    name        input:    The user or group name.                                }
  439. {    objType        input:    The mapping function code: 3 if you're mapping a    }
  440. {                        user name to a user ID or 4 if you're mapping a        }
  441. {                        group name to a group ID.                            }
  442. {    ID            output:    The user or group ID.                                }
  443.  
  444.  
  445. {***************************************************************************}
  446.  
  447.  
  448.     FUNCTION HCopyFile (srcVRefNum: Integer;
  449.                                     srcDirID: LongInt;
  450.                                     srcName: Str255;
  451.                                     dstVRefNum: Integer;
  452.                                     dstDirID: LongInt;
  453.                                     dstPathname: StringPtr;
  454.                                     copyName: StringPtr): OSErr;
  455. {    Use HCopyFile to duplicate a file and optionally to rename it.            }
  456. {    The source and destination volumes must be on the same file server.        }
  457. {                                                                            }
  458. {    srcVRefNum    input:    Source volume specification.                        }
  459. {    srcDirID    input:    Source directory ID.                                }
  460. {    srcName        input:    Source file name.                                    }
  461. {    dstVRefNum    input:    Destination volume specification.                    }
  462. {    dstDirID    input:    Destination directory ID.                            }
  463. {    dstPathname    input:    Pointer to destination directory name, or            }
  464. {                        nil when dstDirID specifies a directory.            }
  465. {    copyName    input:    Points to the new file name if the file is to be    }
  466. {                        renamed or nil if the file isn't to be renamed.        }
  467.  
  468.  
  469. {***************************************************************************}
  470.  
  471.  
  472.     FUNCTION FSpCopyFile (srcSpec: FSSpec;
  473.                                     dstSpec: FSSpec;
  474.                                     copyName: StringPtr): OSErr;
  475. {    Use FSpCopyFile to duplicate a file and optionally to rename it.        }
  476. {    The source and destination volumes must be on the same file server.        }
  477. {                                                                            }
  478. {    srcSpec        input:    An FSSpec record specifying the source file.        }
  479. {    dstSpec        input:    An FSSpec record specifying the destination            }
  480. {                        directory.                                            }
  481. {    copyName    input:    Points to the new file name if the file is to be    }
  482. {                        renamed or nil if the file isn't to be renamed.        }
  483.  
  484.  
  485. {***************************************************************************}
  486.  
  487.  
  488.     FUNCTION HMoveRename (vRefNum: Integer;
  489.                                     srcDirID: LongInt;
  490.                                     srcName: Str255;
  491.                                     dstDirID: LongInt;
  492.                                     dstpathName: StringPtr;
  493.                                     copyName: StringPtr): OSErr;
  494. {    Use HMoveRename to move a file or directory and optionally to rename    }
  495. {    it.  The source and destination locations must be on the same shared    }
  496. {    volume.                                                                    }
  497. {                                                                            }
  498. {    vRefNum        input:    Volume specification.                                }
  499. {    srcDirID    input:    Source directory ID.                                }
  500. {    srcName        input:    The source object name.                                }
  501. {    dstDirID    input:    Destination directory ID.                            }
  502. {    dstName        input:    Pointer to destination directory name, or            }
  503. {                        nil when dstDirID specifies a directory.            }
  504. {    copyName    input:    Points to the new name if the object is to be        }
  505. {                        renamed or nil if the object isn't to be renamed.    }
  506.  
  507.  
  508. {***************************************************************************}
  509.  
  510.  
  511.     FUNCTION FSpMoveRename (srcSpec: FSSpec;
  512.                                     dstSpec: FSSpec;
  513.                                     copyName: StringPtr): OSErr;
  514. {    Use FSpMoveRename to move a file or directory and optionally to            }
  515. {    rename it. The source and destination locations must be on the same        }
  516. {    shared volume.                                                            }
  517. {                                                                            }
  518. {    srcSpec        input:    An FSSpec record specifying the source object.        }
  519. {    dstSpec        input:    An FSSpec record specifying the destination            }
  520. {                        directory.                                            }
  521. {    copyName    input:    Points to the new name if the object is to be        }
  522. {                        renamed or nil if the object isn't to be renamed.    }
  523.  
  524.  
  525. {***************************************************************************}
  526.  
  527.  
  528.     FUNCTION GetVolMountInfoSize (volName: StringPtr;
  529.                                     vRefNum: Integer;
  530.                                     VAR size: Integer): OSErr;
  531. {    Use GetVolMountInfoSize to determine the how much space to allocate        }
  532. {    for a volume mounting information record.                                }
  533. {                                                                            }
  534. {    volName        input:    A pointer to the name of a mounted volume            }
  535. {                        or nil.                                                }
  536. {    vRefNum        input:    Volume specification.                                }
  537. {    size        output:    The space needed (in bytes) of the volume mounting    }
  538. {                        information record.                                    }
  539.  
  540.  
  541. {***************************************************************************}
  542.  
  543.  
  544.     FUNCTION GetVolMountInfo (volName: StringPtr;
  545.                                     vRefNum: Integer;
  546.                                     volMountInfo: Ptr): OSErr;
  547. {    Use GetVolMountInfo to retrieve a volume mounting information record    }
  548. {    containing all the information needed to mount the volume, except        }
  549. {    for passwords.                                                            }
  550. {                                                                            }
  551. {    volName            input:    A pointer to the name of a mounted volume        }
  552. {                            or nil.                                            }
  553. {    vRefNum            input:    Volume specification.                            }
  554. {    volMountInfo    output:    Points to a volume mounting information            }
  555. {                            record where the mounting information is to        }
  556. {                            be returned.                                    }
  557.  
  558.  
  559. {***************************************************************************}
  560.  
  561.  
  562.     FUNCTION VolumeMount (volMountInfo: Ptr;
  563.                                     VAR vRefNum: Integer): OSErr;
  564. {    Use VolumeMount to mount a volume using a volume mounting information    }
  565. {    record.                                                                    }
  566. {                                                                            }
  567. {    volMountInfo    inout:    Points to a volume mounting information record.    }
  568. {    vRefNum            output:    A volume reference number.                        }
  569.  
  570.  
  571. {***************************************************************************}
  572.  
  573.  
  574.     FUNCTION Share (vRefNum: Integer;
  575.                                     dirID: LongInt;
  576.                                     name: StringPtr): OSErr;
  577. {    Use Share to establish a local volume or directory as a share point.    }
  578. {                                                                            }
  579. {    vRefNum            input:    Volume specification.                            }
  580. {    dirID            input:    Directory ID.                                    }
  581. {    name            input:    Pointer to directory name, or nil if dirID        }
  582. {                            specifies the directory.                        }
  583.  
  584.  
  585. {***************************************************************************}
  586.  
  587.  
  588.     FUNCTION FSpShare (spec: FSSpec): OSErr;
  589. {    Use FSpShare to establish a local volume or directory as a share point.    }
  590. {                                                                            }
  591. {    spec    input:    An FSSpec record specifying the share point.            }
  592.  
  593.  
  594. {***************************************************************************}
  595.  
  596.  
  597.     FUNCTION Unshare (vRefNum: Integer;
  598.                                     dirID: LongInt;
  599.                                     name: StringPtr): OSErr;
  600. {    Use Unshare to remove a share point.                                    }
  601. {                                                                            }
  602. {    vRefNum            input:    Volume specification.                            }
  603. {    dirID            input:    Directory ID.                                    }
  604. {    name            input:    Pointer to directory name, or nil if dirID        }
  605. {                            specifies the directory.                        }
  606.  
  607.  
  608. {***************************************************************************}
  609.  
  610.  
  611.     FUNCTION FSpUnshare (spec: FSSpec): OSErr;
  612. {    Use FSpUnshare to remove a share point.                                    }
  613. {                                                                            }
  614. {    spec    input:    An FSSpec record specifying the share point.            }
  615.  
  616.  
  617. {***************************************************************************}
  618.  
  619.  
  620.     FUNCTION GetUGEntry (objType: Integer;
  621.                                     objName: StringPtr;
  622.                                     VAR objID: LongInt): OSErr;
  623. {    Use GetUGEntry to get a list of user or group entries from the            }
  624. {    local file server.                                                        }
  625. {                                                                            }
  626. {    objType        input:    The object type: -1 = group; 0 = user                }
  627. {    objName        input:    Points to a buffer (minimum Str31) where the user    }
  628. {                        or group name is to be returned or must be nil.        }
  629. {                output:    The user or group name.                                }
  630. {    objID        input:    O to get the first user or group. If the entry        }
  631. {                        objID last returned by GetUGEntry is passed, then    }
  632. {                        user or group whose alphabetically next in the list    }
  633. {                        of entries is returned.                                }
  634. {                output:    The user or group ID.                                }
  635.  
  636.  
  637. {***************************************************************************}
  638.  
  639. IMPLEMENTATION
  640.  
  641. END.